//实现两个数组的交集
let s1 = new Set(arr1)
let s2 = new Set(arr2)
let jjarr = []
arr1.forEach(value=>{
    if(s2.has(value))
        jjarr.push(value)
})
console.log([...new Set(jjarr)])
console.log(Array.from(new Set(jjarr)))

//差集
let cjarr = []
arr1.forEach(value=>{
    if(!s2.has(value))
        cjarr.push(value)
})
arr2.forEach(value=>{
    if(!s1.has(value))
        cjarr.push(value)
})
console.log(cjarr)
console.log([...new Set(cjarr)])